<template>
    <div>
        <h1 algin="center">房号列表</h1>

        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>房号</td>
                    <td>房型</td>
                    <td>房型状态</td>
                    <td>房间价格</td>
                    <td>房号状态</td>
                </tr>

                <tr v-for="item in data.list" :key="item.id">
                    <td>{{item.houseNoName}}</td>
                    <td>
                        <span v-if="item.houseTypeId==1">大床房</span>
                        <span v-if="item.houseTypeId==2">双人间</span>
                        <span v-if="item.houseTypeId==3">总统套房</span>
                    </td>
                    <td>
                        <span v-if="item.houseTypeId==1">空闲</span>
                        <span v-if="item.houseTypeId==2">已预约</span>
                        <span v-if="item.houseTypeId==3">已入住</span>
                    </td>
                    <td>{{item.price}}</td>
                    <td>{{item.isDeleted==1?'上架':'下架'}}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted} from 'vue'
import { useRoute, useRouter } from 'vue-router'
import axios from 'axios'
const route = useRoute()
const router = useRouter()

let data:any = reactive({
    list:[]
})

onMounted(()=>{
    getlist();
})

const getlist = () => {
    axios({
        url:'/api/HouseNo/GetNoPage',
        method:'get',
        params:data
    })
    .then((res)=>{
        console.log(res);
        data.list = res.data;
    })
    .catch((err)=>{
        console.log(err);
    })
}
</script>

<style scoped>

</style>